import { MigrationInterface, QueryRunner } from 'typeorm';

export class Data1729841532015 implements MigrationInterface {
  public async up(queryRunner: QueryRunner): Promise<void> {
    await queryRunner.query(
      "INSERT INTO `users` (`id`, `username`, `password`, `nick_name`, `email`, `headPic`, `phoneNumber`, `isFrozen`, `isAdmin`, `loginType`, `createTime`, `updateTime`) VALUES (1, 'admin', '1962fc1d944a50eccabd39304cd2669a', '超级管理员', '415340716@qq.com', 'http://localhost:9000/meeting-room/avatar1.jpg', NULL, 0, 1, 0, '2024-10-25 06:24:18.746528', '2024-10-25 07:07:00.291913');",
    );
    await queryRunner.query(
      "INSERT INTO `users` (`id`, `username`, `password`, `nick_name`, `email`, `headPic`, `phoneNumber`, `isFrozen`, `isAdmin`, `loginType`, `createTime`, `updateTime`) VALUES (2, 'test1', '1962fc1d944a50eccabd39304cd2669a', '测试1', '415340716@qq.com', 'http://localhost:9000/meeting-room/avatar2.jpg', NULL, 0, 0, 0, '2024-10-25 14:34:33.000000', '2024-10-25 07:21:24.978054');",
    );
    await queryRunner.query(
      "INSERT INTO `meeting_room` (`id`, `name`, `capacity`, `location`, `equipment`, `description`, `isBooked`, `createTime`, `updateTime`) VALUES (2, '1号会议室', 10, 'A座3层301', '华为投影仪', '研发部会议', 0, '2024-10-25 07:14:38.816993', '2024-10-25 07:14:38.816993');",
    );
    await queryRunner.query(
      "INSERT INTO `booking` (`id`, `startTime`, `endTime`, `status`, `note`, `createTime`, `updateTime`, `userId`, `roomId`) VALUES (3, '2024-10-25 08:00:00', '2024-10-25 12:00:00', '审批通过', '', '2024-10-25 07:15:12.878269', '2024-10-25 07:15:33.000000', 2, 2);",
    );
  }

  public async down(queryRunner: QueryRunner): Promise<void> {
    await queryRunner.query('TRUNCATE TABLE booking');
  }
}
